import React from 'react';

import BaseExecuter from '../common/BaseExecuter';
import Constants from '../../common/Constants';

import DataManager from '../../datas/DataManager';

export default class NewsExecuter extends BaseExecuter {
  constructor() {
    super();
  }

  execute(action) {
    switch (action.name) {
      case "NewsRequestContentAction":
        this._requestContent(action);
        break;
      case "NewsRequestCommonListAction":
        this._requestCommentList(action);
        break;
      case "RequestNewsPostsAction":
        this._requestPosts(action);
        break;
      case "RequestNewsSeacrhListAction":
        this._sendRequestSeacrhList(action);
        break;
      case "NewsSendCommentAction":
        this._sendComment(action);
        break;
      case "NewsSendCommentListAction":
        this._sendCommentShow(action);
        break;
      case "NewsSendCommentFollowAction":
        this._sendCommentFollow(action);
        break;   
      case "NewsRequestLikeAction":
        this._sendLike(action);
        break;
      case "NewsRequestMyNewsNumAction":
        this._sendRequestMyNewsNum(action);
        break;
      case "NewsRequestMyNewsAction":
        this._sendRequestMyNews(action);
        break;
      case "NewsRequestNewsByTopicsAction":
        this._sendRequestNewsByTopics(action);
        break;
      default:
    }
  }

  _sendRequestNewsByTopics(action) {
    this._sendRequestCommonResponse(action, "sendRequestNewsByTopics");
  }

  _sendRequestMyNews(action) {
    this._sendRequestCommonResponse(action, "sendRequestMyNews");
  }

  _sendRequestMyNewsNum(action) {
    this._sendRequestCommonResponse(action, "sendRequestMyNewsNum");
  }
  _sendRequestSeacrhList(action) {
    this._sendRequestCommonResponse(action, "sendRequestSearchList");
  }
  _sendLike(action) {
    this._sendRequestCommonResponse(action, "sendLike");
  }

  _sendComment(action) {
    this._sendRequestCommonResponse(action, "sendComment");
  }
  _sendCommentFollow(action) {
    this._sendRequestCommonResponse(action, "sendCommentFollow");
  }
  _sendCommentShow(action) {
    this._sendRequestCommonResponse(action, "sendCommentShow");
  }
  
  _requestContent(action) {
    this._sendRequestCommonResponse(action, "sendRequestContent");
  }

  _requestCommentList(action) {
    //board_id 版块ID, 1，创新创效
    //page
    //page_size
    //post_id 帖子ID
    this._sendRequestCommonResponse(action, "requestComment");
  }

  _requestPosts(action) {
    this._sendRequestCommonResponse(action, "sendRequestList");
  }

  _getModuleType() {
    return Constants.MODULE_TYPE.NEWS;
  }
}
